package eleanor.ltd.isne.entities.roles.group;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import eleanor.ltd.isne.entities.pages.action.PagesAction;
import eleanor.ltd.isne.entities.pages.action.PagesActionPK;
import eleanor.ltd.isne.entities.roles.Roles;

@Embeddable
public class RolesGroupPK implements Serializable{
	
	
	@ManyToOne
	private Roles roles;
	@ManyToOne
	private PagesAction pagesAction;
	
	public Roles getRoles() {
		return roles;
	}
	public void setRoles(Roles roles) {
		this.roles = roles;
	}
	public PagesAction getPagesAction() {
		return pagesAction;
	}
	public void setPagesAction(PagesAction pagesAction) {
		this.pagesAction = pagesAction;
	}
	
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		RolesGroupPK that = (RolesGroupPK) o;

		if (roles != null ? !roles.equals(that.roles) : that.roles != null)
			return false;
		if (pagesAction != null ? !pagesAction.equals(that.pagesAction)
				: that.pagesAction != null)
			return false;

		return true;
	}
	
	
}
